﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TR.Domain.Entity;

namespace TR.EFCore.Configers
{
    public class sys_EncodeConfigure : IEntityTypeConfiguration<sys_Encode>
    {
        public void Configure(EntityTypeBuilder<sys_Encode> builder)
        {
            builder.ToTable(nameof(sys_Encode));
            builder.HasKey(e => e.en_code);
            builder.Property(e => e.en_form).HasMaxLength(64).IsUnicode(false).IsRequired(false);
            builder.Property(e => e.en_prefix).HasMaxLength(30).IsUnicode(false).IsRequired(false);
            builder.Property(e => e.en_time).HasMaxLength(50).IsUnicode(false).IsRequired(false);
            builder.Property(e => e.en_num).IsRequired();
            builder.Property(e => e.en_step).IsRequired();
            builder.Property(e => e.en_rules).HasMaxLength(80).IsUnicode(false).IsRequired(false);
            builder.Property(e => e.create_by).HasMaxLength(64).IsUnicode(false).IsRequired(false);
            builder.Property(e => e.create_time).HasMaxLength(64).IsRequired(false);
            builder.Property(e => e.is_del).IsRequired();
        }
    }
}
